import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import set_nodes_cls from '@dfeidao/atom-web/ui/set-nodes-cls';
import fire from '@dfeidao/atom-web/msg/fire';
import set from '@dfeidao/atom-web/local/set';


export default async function a002(fd: IFeidaoAiBrowserComponent, e: Event) {
	const d = e.currentTarget as HTMLDivElement;
	//只能选择一行那一行数据有背景色-（取消所有行背景色）查到所有行
	const nodes = fd.data.node.querySelectorAll('[data-color="blue"]');
	const ns = Array.from(nodes) as HTMLDivElement[];//获取到的行数据转换为数组
	set_nodes_cls(ns, 'bg-select', false);//取消所有背景色
	set_node_cls(d, 'bg-select', true);//加选中数据背景色	
	// 获取data-v里面存的属性
	const d_name = d.getAttribute('data-name');
	const d_level = d.getAttribute('data-level');
	const nos = d.getAttribute('data-no');
	set(fd, 'nos', nos);
	set(fd, 'd_name', d_name);
	set(fd, 'd_level', d_level);
	fire('zj-000005', 'a001', d_name, d_level, nos);


}
